<?php
/**
 * ===============================================
 * 版权所有 2019-2050 青岛铁锤科技有限公司，并保留所有权利。
 * 网站地址: http://www.huaxianling.com
 * ===============================================
 * Author: Happy dong
 * Created Time: 2019-07-08 18:54
 *
 * Version: 2.0
 */

namespace App\Modules\Employee\Validators;


use Flower\Core\Repository\Contracts\ValidatorInterface;
use Flower\Core\Repository\Validator\LaravelValidator;

class SalaryValidator extends LaravelValidator
{
	protected $rules = [
		ValidatorInterface::RULE_CREATE => [
			// 手机号码 必填 唯一性验证 正则匹配验证
			'user_id' => 'sometimes|required|numeric',
			'store_id' =>'sometimes|required|numeric',
			'amount'     => 'sometimes|numeric',
			'royalty'     => 'sometimes|numeric',
		],
		ValidatorInterface::RULE_UPDATE => [
			'user_id' => 'filled|numeric',
			'store_id' =>'filled|numeric',
		]
	];
	protected $messages = [
		'user_id.required'  => '用户id不能为空',
		'user_id.numeric'   => '格式不对，必须为数字',
		'store_id.required' => '店铺id不能为空',
		'store_id.numeric'   => '格式不对，必须为数字',
		'royalty.numeric'    => '格式不对，必须为数字',
		'amount.numeric'    => '格式不对，必须为数字',
	];

}